import java.util.Scanner;

import edu.hawaii.ics414.blackjack.practiceMode.*;
import edu.hawaii.ics414.blackjack.tournamentMode.*;

public class Game {

  /**
   * @param args
   */
  public static void main(String[] args) {
    String Choice = "";
    PracticeMode pMode = new PracticeMode();
    tournamentMode tMode = new tournamentMode();
    System.out.println("********************************************");
    System.out.println("********************************************");
    System.out.println("**                                        **");
    System.out.println("**                                        **");
    System.out.println("**     ####   #       #    ###  #  ##     **");
    System.out.println("**     #   #  #      # #  #   # # #       **");
    System.out.println("**     ####   #      ###  #     ##        **");
    System.out.println("**     #   #  #     #   # #   # # #       **");
    System.out.println("**     ####   ##### #   #  ###  #  ##     **");
    System.out.println("**                                        **");
    System.out.println("**                                        **");
    System.out.println("**        #####   #    ###  #  ##         **");
    System.out.println("**           #   # #  #   # # #           **");
    System.out.println("**        #  #   ###  #     ##            **");
    System.out.println("**        #  #  #   # #   # # #           **");
    System.out.println("**        ###   #   #  ###  #  ##         **");
    System.out.println("**                                        **");
    System.out.println("**                                        **");
    System.out.println("**                             Branden O. **");
    System.out.println("**                             Wei W.     **");
    System.out.println("********************************************");
    System.out.println("********************************************");
    Scanner scan = new Scanner(System.in);
    int input = -1;
    while(input != 1 || input != 2)
    {
      System.out.println("Please choose a game mode.");
      System.out.println("1. Tournament Mode (enter 1)");
      System.out.println("2. Practice Mode (enter 2)");
      try
      {
        input = scan.nextInt();
        if(input != 1 && input != 2)
        {
          System.out.println("You can only choose between option 1 and option 2.");
        } 
        else if(input == 1) 
        {
          if(tMode.Tournament(1))
          {
            System.out.println("");
            System.out.println("");
          	System.out.println("***************************************************************");
          	System.out.println("*                                                             *");
          	System.out.println("*  Congratulations!!! You have advanced to the next round!!!  *");
          	System.out.println("*                                                             *");
          	System.out.println("***************************************************************");
            if(tMode.Tournament(2))
            {
              System.out.println("");
              System.out.println("");
            	System.out.println("***************************************************************");
            	System.out.println("*                                                             *");
            	System.out.println("*  Congratulations!!! You have advanced to the next round!!!  *");
            	System.out.println("*                                                             *");
            	System.out.println("***************************************************************");
              if(tMode.Tournament(3))
              {
                System.out.println("");
                System.out.println("");
              	System.out.println("***********************************************");
              	System.out.println("*                                             *");
              	System.out.println("*               Congratulations!!!            *");
              	System.out.println("*        You have won the tournament!!!       *");
              	System.out.println("*  Please look forward to the Career Mode!!!  *");
              	System.out.println("*                                             *");
              	System.out.println("***********************************************");
              	System.out.println("");
              	System.out.println("");
              	System.out.println("");
              	System.out.println("");
              	System.out.println("");
              }
            }
          }
        }
        else
        {
          pMode.GameStart();
        }
      }
      catch (NumberFormatException nfe)
      {
        System.out.println("Please only enter option 1 or 2.");
      }
    }

  }

}
